package com.app.ytong.bean;

import android.content.Context;
import android.text.TextUtils;

import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;

import my.DialogUtils;
import my.MathUtils;
import my.SystemParamsUtils;

public class GoodsListData extends BasisBean {

    /**
     *   {
     *                "gid": "1486981940928376833",
     *                "aid": "2",
     *                "ifs": "1",
     *                "tid": "1485870325336141825",
     *                "tna": "贡眉",
     *                "lid": "1485873004053831682",
     *                "lna": "一级",
     *                "gno": "1b0001k3570000",
     *                "gna": "2021一级绿茶",
     *                "gsp": "357g",
     *                "gun": "g",
     *                "path": null,
     *                "uno": "admin"
     *                "tno": ""
     *                "lno": ""
     *                "tno": ""
     *                "sno": ""
     *               }
     */
    private static final long serialVersionUID = 1L;


    @JSONField(name = "gid")
    private String gid;
    @JSONField(name = "aid")
    private String aid;
    @JSONField(name = "ifs")
    private String ifs;
    @JSONField(name = "tid")
    private String tid;
    @JSONField(name = "tna")
    private String tna;
    @JSONField(name = "lid")
    private String lid;
    @JSONField(name = "lna")
    private String lna;
    @JSONField(name = "gno")
    private String gno;
    @JSONField(name = "gna")
    private String gna;
    @JSONField(name = "gsp")
    private String gsp;
    @JSONField(name = "gun")
    private String gun;         //货品单位units-tna名称
    @JSONField(name = "path")
    private String path;
    @JSONField(name = "uno")
    private String uno;     //用户uno编码
    @JSONField(name = "tno")
    private String tno;         //分类编码
    @JSONField(name = "lno")
    private String lno;     //等级编码
    @JSONField(name = "yno")
    private String yno;     //年份编码

    @JSONField(name = "yid")
    private String yid;     //年份ID
    @JSONField(name = "yna")
    private String yna;     //年份名称
    @JSONField(name = "sno")
    private String sno;     //序号


    @JSONField(name = "mid")
    private String mid;     //单号
    @JSONField(name = "pid")
    private String pid;     //小票上的条形码

    /**
     * 下面是提交需要的字段
     */

    @JSONField(name = "cno")
    private String cno ;   //供应商手机


    @JSONField(name = "cid")
    private String cid ;

    @JSONField(name = "jno")
    private String jno ;
    @JSONField(name = "idt")
    private String idt ;   //入库日期


    @JSONField(name = "cna")
    private String cna ;   //供应商名称
    @JSONField(name = "wno")
    private String wno ;   //设备号

    @JSONField(name = "wna")
    private String wna ;   //设备名称

    @JSONField(name = "gwt")
    private String gwt;     //货品重量


    @JSONField(name = "gnum")
    private String gnum;     //库存


    @JSONField(name = "pwt")
    private String pwt = "0";         //去皮重量

    @JSONField(name = "pri")
    private String pri;     //单价


    @JSONField(name = "gnu")
    private int gnu =1;     //每箱数量

    @JSONField(name = "rfid")
    private String rfid;


    @JSONField(name = "fsg")
    private String fsg;   //1采购    2生产


    @JSONField(name = "cdno")
    private String cdno;

    @JSONField(name = "acc")
    private int acc = 1;   //累加


    @JSONField(serialize = false)
    boolean isSelect = false;

    @JSONField(name = "sty")
    private int sty = 1;    // 1正常   2挂单


    public String getJno() {
        return jno;
    }

    public void setJno(String jno) {
        this.jno = jno;
    }


    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    public String getCdno() {
        return cdno;
    }

    public void setCdno(String cdno) {
        this.cdno = cdno;
    }

    public boolean isGuadan(){
        if(getSty() == GoodsListBean.ISGUADAN){
            return true;
        }
        return false;
    }

    @JSONField(serialize = false)
    public int getMax(){
        switch (gun){
            case "箱":
               return 1;
            default:
                return 9999;
        }
    }

    @JSONField(serialize = false)
    public String getMoney(){
        return MathUtils.multiply(pri,gwt);
    }

    public String getWna() {
        return wna;
    }

    public void setWna(String wna) {
        this.wna = wna;
    }


    public int getSty() {
        return sty;
    }

    public void setSty(int sty) {
        this.sty = sty;
    }


    public int getAcc() {
        return acc;
    }

    public void setAcc(int acc) {
        this.acc = acc;
    }

    public String getPwt() {
        if(TextUtils.isEmpty(pwt) || "null".equals(pwt))return "0";
        return pwt;
    }

    public void setPwt(String pwt) {
        this.pwt = pwt;
    }



    public String getFsg() {
        return fsg;
    }

    public void setFsg(String fsg) {
        this.fsg = fsg;
    }

    public String getIdt() {
        return idt;
    }

    public void setIdt(String idt) {
        this.idt = idt;
    }

    public String getGid() {
        return gid;
    }

    public void setGid(String gid) {
        this.gid = gid;
    }

    public String getAid() {
        return aid;
    }

    public void setAid(String aid) {
        this.aid = aid;
    }

    public String getIfs() {
        return ifs;
    }

    public void setIfs(String ifs) {
        this.ifs = ifs;
    }

    public String getTid() {
        return tid;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public String getTna() {
        return tna;
    }

    public void setTna(String tna) {
        this.tna = tna;
    }

    public String getLid() {
        return lid;
    }

    public void setLid(String lid) {
        this.lid = lid;
    }

    public String getLna() {
        return lna;
    }

    public void setLna(String lna) {
        this.lna = lna;
    }

    public String getGno() {
        return gno;
    }

    public void setGno(String gno) {
        this.gno = gno;
    }

    public String getGna() {
        return gna;
    }

    public void setGna(String gna) {
        this.gna = gna;
    }

    public String getGsp() {
        return gsp;
    }

    public void setGsp(String gsp) {
        this.gsp = gsp;
    }

    public String getGun() {
        return gun;
    }

    public void setGun(String gun) {
        this.gun = gun;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getUno() {
        return uno;
    }

    public void setUno(String uno) {
        this.uno = uno;
    }

    public String getGwt() {
        return gwt;
    }

    public void setGwt(String gwt) {
        this.gwt = gwt;
    }

    public String getPri() {
        return pri;
    }

    public void setPri(String pri) {
        this.pri = pri;
    }


    public String getRfid() {
        return rfid;
    }

    public void setRfid(String rfid) {
        this.rfid = rfid;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    public String getWno() {
        return wno;
    }

    public void setWno(String wno) {
        this.wno = wno;
    }

    public String getCno() {
        return cno;
    }

    public void setCno(String cno) {
        this.cno = cno;
    }

    public String getCna() {
        return cna;
    }

    public void setCna(String cna) {
        this.cna = cna;
    }

    public int getGnu() {
        return gnu;
    }

    public void setGnu(int gnu) {
        this.gnu = gnu;
    }

    public String getTno() {
        return tno;
    }

    public void setTno(String tno) {
        this.tno = tno;
    }

    public String getLno() {
        return lno;
    }

    public void setLno(String lno) {
        this.lno = lno;
    }

    public String getYno() {
        return yno;
    }

    public void setYno(String yno) {
        this.yno = yno;
    }

    public String getSno() {
        return sno;
    }

    public void setSno(String sno) {
        this.sno = sno;
    }

    public String getMid() {
        return mid;
    }

    public void setMid(String mid) {
        this.mid = mid;
    }
    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getGnum() {
        return gnum;
    }

    public void setGnum(String gnum) {
        this.gnum = gnum;
    }

    public String getYid() {
        return yid;
    }

    public void setYid(String yid) {
        this.yid = yid;
    }

    public String getYna() {
        return yna;
    }

    public void setYna(String yna) {
        this.yna = yna;
    }


}
